package com.orderMeal.business.authority.action;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.orderMeal.business.authority.service.AdminManageService;
import com.orderMeal.business.index.model.IndexShowPictureModel;
import com.orderMeal.common.action.BaseAction;
@Controller("adminManageAction")
public class AdminManageAction extends BaseAction {
	private static final long serialVersionUID = -6052160112585778003L;
	@Resource(name="adminManageService")
	private AdminManageService adminManageService;
	private IndexShowPictureModel indePicModel;
	public String showAdminManageIndex(){
		return "success";
	}
	/**
	 * 首页banner图片管理
	 * @return
	 */
	public String showIndexBannerPic(){
		List pictureList= adminManageService.queryAll("from IndexShowPictureModel");
		super.setRequestAttribute("pictureList", pictureList);
		return "bannerManager";
	}
	public String deleteBannerPic(){
		String picId = super.getRequestParameter("picId");
		indePicModel = new IndexShowPictureModel();
		indePicModel.setId(Integer.valueOf(picId));
		adminManageService.delete(indePicModel);
		super.renderText("success");
		return null;
	}
}
